import Layout from '@/layout'
import webLayout from '@/layout/webLayout'
export const AppRouter = [
  {
    path: '/web',
    name: '前端',
    redirect:  '/web/service',
    hidden: true,
    component: webLayout,
    children: [
      {
        path: 'service',
        name: 'webs',
        component: r => require.ensure([],()=>r(require('@/views/web/index')),'web'),
        meta: { name: '前台'}
      }
    ]
  },
  {
    path: '/admin',
    name: '后台管理模块',
    redirect: '/admin/user-manage',
    component: Layout,
    children: [
      {
        path: 'user-manage',
        name: '用户管理',
        component: r=> require.ensure([],() => r(require('@/views/admin/user-manage/index.vue')), 'userManage'),
        meta: { title: '人员管理' ,icon: 'user-mange' }
      }
    ]
  },
  {
    path: '/admin/role',
    name: '角色管理模块',
    redirect: '/admin/role/role-manage',
    component: Layout,
    children: [
      {
        path: 'role-manage',
        name: '角色管理',
        component: r=> require.ensure([],() => r(require('@/views/admin/role-manage/index.vue')), 'RoleManage'),
        meta: { title: '角色管理', icon: 'role-mange'}
      }
    ]
  },
  {
    path: '/admin/menu-manage',
    name: '菜单管理模块',
    component: Layout,
    redirect: '/admin/menu-manage/list',
    children: [
      {
        path: 'list',
        name: '菜单管理',
        component: r=> require.ensure([],() => r(require('@/views/admin/menu-manage/index.vue')), 'MenuManage'),
        meta: { title: '菜单管理', icon: 'menu-mange'}
      }
    ]
  },
  {
    path: '/admin/service-manage',
    name: '服务管理模块',
    component: Layout,
    redirect: '/admin/service-manage/list',
    children: [
      {
        path: 'list',
        name: '服务管理',
        component: r=> require.ensure([],() => r(require('@/views/admin/service-manage/index.vue')), 'ServiceManage'),
        meta: { title: '服务管理', icon: 'service-mangage'}
      },
      {
        path: 'dev',
        name: '高级运维',
        hidden: true,
        component: r=> require.ensure([],() => r(require('@/views/admin/service-manage/dev.vue')), 'devManage'),
        meta: { title: '高级运维', icon: 'dev-mangage'}
      },
      {
        path: 'base-service',
        name: '编辑基础服务',
        hidden: true,
        component: r=> require.ensure([],() => r(require('@/views/admin/service-manage/base-service.vue')), 'BaseService'),
        meta: { title: '编辑基础服务', icon: 'dev-mangage'}
      },
      {
        path: 'advanced-service',
        name: '编辑进阶服务',
        hidden: true,
        component: r=> require.ensure([],() => r(require('@/views/admin/service-manage/advanced-service.vue')), 'AdvancedService'),
        meta: { title: '编辑进阶服务', icon: 'dev-mangage'}
      }
    ]
  },
  {
    path: '/admin/service-cous',
    name: '服务统计模块',
    redirect: '/admin/service-cous/list',
    component: Layout,
    children: [
      {
        path: 'list',
        name: '服务统计',
        component: r=> require.ensure([],() => r(require('@/views/admin/service-statistics/index.vue')), 'serviceCounts'),
        meta: { title: '服务统计', icon: 'service-statistics'}
      },
      {
        path: 'info',
        name: '统计详细信息',
        component: r=> require.ensure([],() => r(require('@/views/admin/service-statistics/info.vue')), 'serviceCountsInfo'),
        meta: { title: '统计详细信息'},
        hidden: true,
      }
    ]
  },
  {
    path: '/admin/service-file',
    name: '系统配置模块',
    redirect: '/admin/service-file/list',
    component: Layout,
    children: [
      {
        path: 'list',
        name: '系统配置',
        component: r=> require.ensure([],() => r(require('@/views/admin/service-file/index.vue')), 'serviceFileManage'),
        meta: { title: '系统配置', icon: 'el-icon-s-platform'}
      }
    ]
  },
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: () => import('@/views/BaseView/redirect/index')
      }
    ]
  },
]